<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8"/>
        <title>
            事件处理01
        </title>
        <script type="text/javascript" src="../js/vue.js"></script>
    </head>
    <body>
        
        <div id="root">
            Hello Creams, {{name}}
            <button v-on:click="showInfo">点我提示</button>
            <button @click="showInfo">点我提示2</button>
            <button @click="showInfo2($event, 6666)">点我提示3</button>
        </div>
        <script type="text/javascript">
            const vm = new Vue({
                el: "#root",
                data:{
                    name: "王五"
                },
                methods: {
                    showInfo(event){
                        alert("Hello, I am robot")
                        console.log(event.target.innerText)
                    },
                    showInfo2(event, number){
                        alert("Hello, I am robot2")
                        console.log(event.target.innerText, number)
                    }
                },
            })
        </script>
    </body>
</html>